<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <link rel="stylesheet" href="css/main.css">
    <LINK href="${pageContext.request.contextPath }/css/main.css" type=text/css rel=stylesheet>
    <title>Crm</title>
</head>
<body>

<header id="top"></header>

<aside id="menu"></aside>


<div id="content">
    <form  id="loginForm"action="login_student">
        <label></label><input type="text" name="username"><br/>
        <label></label><input type="password" name="password"><br/>
        <input type="submit">
    </form>

</div>
<script src="js/jquery-3.1.1.js"></script>
<script src="js/main.js"></script>
<script>
    $('input[type="submit"]').click(function () {
        console.log("submit");
        $.post('login_student', $('#loginForm').serialize(), function (data) {
                    console.log(data);
                    if (data.retcode==0) {
                        window.location="homework_homeTask"
                    }else {
                        alert(data.msg)
                    }
                },
                'json' // I expect a JSON response
        );
        return false;
    });

</script>
</body>
</html>